﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="SacNetUG.WebForm1" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
    <title>Untitled Page</title>
</head>
<body onload="init()">
    <form id="form1" runat="server">
            <script language="javascript" type="text/javascript">
                var userArray = new Array();
                function init() {

                    userArray[0] = { id: 1, name: "Jason" };
                    userArray[1] = { id: 2, name: "Liz" };
                    userArray[2] = { id: 4, name: "Wes" };
                    userArray[3] = { id: 6, name: "Will" };

                    populateLabels();
                }



                function populateLabels() {
                    var i = 0;
                    var elementId = "";
                    while (i < userArray.length) {
                        elementId = "Sequence" + i;
                        //document.getElementById(elementId).firstChild.nodeValue = userArray[i].name;
                        document.getElementById(elementId).value = userArray[i].name;

                        i++;
                    }

                }

                function pushDown(id) {
                    var swap = userArray[id + 1];
                    userArray[id + 1] = userArray[id];
                    userArray[id] = swap;

                    populateLabels();
                }
                function pushUp(id) {
                    var swap = userArray[id - 1];
                    userArray[id - 1] = userArray[id];
                    userArray[id] = swap;
                    populateLabels();
                }
    </script>
    
    <div>
    <form action="Default.aspx" method="post">
    <input type="text" id="Sequence0" name="Sequence0" value="" />
    <input type="button" onclick="pushDown(0)" value="\/" />
    <br />
    <input type="text" id="Sequence1" name="Sequence1" value="" />
    <input type="button" onclick="pushDown(1)" value="\/" />
    <input type="button" onclick="pushUp(1)" value="/\" />
    <br />
    <input type="text" id="Sequence2" name="Sequence2" value="" />
    <input type="button" onclick="pushDown(2)" value="\/" />
    <input type="button" onclick="pushUp(2)" value="/\" />
    <br />
    <input type="text" id="Sequence3" name="Sequence3" value="" />
    <input type="button" value="v" style="visibility: hidden" />
    <input type="button" onclick="pushUp(3)" value="/\" />
    </form>
    </div>
    </form>
</body>
</html>
